﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Search.ascx.cs" Inherits="UserControl_Search" %>

    <link href="<%= ResolveUrl("~/Styles/dd.css")%>" rel="stylesheet" type="text/css" />
    <script src="<%= ResolveUrl("~/Scripts/jquery.dd.js")%>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Scripts/dropdownAPI.js")%>" type="text/javascript"></script>
    <script>
        $(document).ready(function() {
        try {
            oHandler = $("#<%=ddlSearch.ClientID %>").msDropDown({ mainCSS: 'dd2' }).data("dd");
            $("#ver").html($.msDropDown.version);
            //alert(oHandler.get([value]));
		        } catch(e) {
			        alert("Error: "+e.message);
		        }
			});
			function SetOption(element) {
			    document.getElementById('<%= hdnSelectOption.ClientID %>').value =element.value;
			}
			function checknullkeyword() {
			    var para = $("#<%= txtkeyword.ClientID %>").val();
			    if (para == "" || para == "Enter search text") {
			        alert("Nhập từ khóa tìm kiếm");
			        return false;
			    }
            }
    </script>
    <div id="search_panel">
        <div id="Tabs">
            <div id="TabbedPanels1" class="TabbedPanels">
                <div class="TabbedPanelsContent">
                    <asp:Panel ID="panelsearch" runat="server" DefaultButton="btnSearch">
                        <asp:TextBox ID="txtkeyword" runat="server" CssClass="search_feild2" Text="Enter search text" ForeColor = "Gray" onblur = "WaterMark(this, event);" onfocus = "WaterMark(this, event);" ></asp:TextBox>
                        <asp:DropDownList ID="ddlSearch" runat="server" onchange="SetOption(this)">
                            <asp:ListItem Text="Doanh nghiệp" Value="DN"></asp:ListItem>
                            <asp:ListItem Text="Sản phẩm" Value="PR"></asp:ListItem>
                        </asp:DropDownList>
                        <asp:Button ID="btnSearch" runat="server" Text="Seach" CssClass="searc_btn" OnClientClick="javascript:return checknullkeyword();" 
                            onclick="btnSearch_Click" />
                    </asp:Panel>
                </div>
            </div>
            <script type="text/javascript">
                var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
            </script>
        </div>
    </div>
    <asp:HiddenField ID="hdnSelectOption" runat="server" Value="DN" />